
var ajaxNoticeTimer = null;
var ajaxNoticeTime =60*60 *1000;

var noticeTimer = null;
var noticeTime = 150;
var noticeBoxWidth = 900;

var noticeTotalWidth = 0;
var noticeCurLeft = 0;
var noticeAddValue = 8;

function init(){
	var html = 'this is marquee ..';
	initNoticeBox(html);
}


function initNoticeBox(html){
	var noticeBox = document.getElementById('noticeBox');
	noticeBox.style.display = 'block';
	if(noticeTimer){
		clearInterval(noticeTimer);noticeTimer = null;
	}
	
	var noticeCon = document.getElementById('noticeCon');
	noticeCon.innerHTML = '<div class="inline">'+html+'</div>';
	noticeCon.style.left = noticeBoxWidth;
	
	var child = noticeCon.childNodes[0];
	noticeTotalWidth = child.offsetWidth;
	
	
	
	noticeCurLeft = noticeBoxWidth;
	noticeTimer = setInterval("startNoticeMove()",noticeTime);
}


function startNoticeMove(){
	noticeCurLeft = noticeCurLeft - noticeAddValue;
	var noticeCon = document.getElementById('noticeCon');
	noticeCon.style.left = noticeCurLeft;
	
	
	if(noticeCurLeft + noticeTotalWidth < 0){
		noticeCurLeft = noticeBoxWidth;
	}
}